@extends('layouts.app')

@section('title', isset($category) ? $category->name : '话题列表')

@section('sryle-class','tt-offset-small')
@section('content')
    <div class="container">

        <div class="row">
            <div class="col-lg-8">
                @if(isset($category))
                    <div class="alert alert-info" role="alert">
                        {{ $category->name }} ：{{ $category->description }}
                    </div>
                @endif

                <ul class="nav nav-pills">
                    <li class="nav-item">
                        <a class="btn btn-primary btn-sm {{ active_class( ! if_query('order', 'recent')) }}"
                           href="{{ Request::url() }}?order=default">
                            最后回复
                        </a>
                    </li>
                    <li class="nav-item" style="margin-left: 20px">
                        <a class="btn btn-primary btn-sm {{ active_class(if_query('order', 'recent')) }}"
                           href="{{ Request::url() }}?order=recent">
                            最新发布
                        </a>
                    </li>
                </ul>

                <div class="tt-topic-list">
                    <div class="tt-list-header">
                        <div class="tt-col-topic">话题</div>
                        <div class="tt-col-category">分类</div>
                        <div class="tt-col-value hide-mobile">喜欢</div>
                        <div class="tt-col-value hide-mobile">回复</div>
                        <div class="tt-col-value hide-mobile">访问</div>
                        <div class="tt-col-value">活跃</div>
                    </div>
                    {{--<div class="tt-topic-alert tt-alert-default" role="alert">--}}
                    {{--<a href="#" target="_blank">4 new posts</a> are added recently, click here to load them.--}}
                    {{--</div>--}}

                    {{-- 话题列表 --}}
                    @include('topics._topic_list', ['topics' => $topics])

                    <div class="tt-row-btn">
                        {!! $topics->appends(Request::except('page'))->render() !!}
                    </div>

                    {{--<div class="tt-item tt-item-popup">--}}
                    {{--<div class="tt-col-avatar">--}}
                    {{--<svg class="tt-icon">--}}
                    {{--<use xlink:href="#icon-ava-f"></use>--}}
                    {{--</svg>--}}
                    {{--</div>--}}
                    {{--<div class="tt-col-message">--}}
                    {{--Looks like you are new here. Register for free, learn and contribute.--}}
                    {{--</div>--}}
                    {{--<div class="tt-col-btn">--}}
                    {{--<button type="button" class="btn btn-primary">Log in</button>--}}
                    {{--<button type="button" class="btn btn-secondary">Sign up</button>--}}
                    {{--<button type="button" class="btn-icon">--}}
                    {{--<svg class="tt-icon">--}}
                    {{--<use xlink:href="#icon-cancel"></use>--}}
                    {{--</svg>--}}
                    {{--</button>--}}
                    {{--</div>--}}
                    {{--</div>--}}
                    {{--<div class="tt-row-btn">--}}
                    {{--<button type="button" class="btn-icon js-topiclist-showmore">--}}
                    {{--<svg class="tt-icon">--}}
                    {{--<use xlink:href="#icon-load_lore_icon"></use>--}}
                    {{--</svg>--}}
                    {{--</button>--}}
                    {{--</div>--}}
                </div>
            </div>
            <div class="col-lg-3 col-lg-offset-1">
                @include('topics._sidebar')
            </div>
        </div>
    </div>
    </main>
@endsection
